Skip to content

Refactor time until death calculations#160

Merged
yiwen-h merged 5 commits intomainfrom
151_153_refactor-time-until-death-calculations
Jan 19, 2026
Merged

Refactor time until death calculations#160
yiwen-h merged 5 commits intomainfrom
151_153_refactor-time-until-death-calculations

Conversation

@yiwen-h
Copy link
Member

@yiwen-h yiwen-h commented Jan 19, 2026

Closes #151
Closes #153

Have compared model results with validation run prior to code changes and they are exactly the same (with exception of mortality in year sim_duration + 1 - previously we were truncating time to death, now we do not). This is mostly just rearranging things to make them clearer.

For example, in config instead of relying on developers remembering that the first value in the list is the shape and the second value is the scale, we are now very explicit about naming what the values are.

before:

"initialisation": {
    "not_listed": {
        "early": {
            1: [0.926963321, 2127.231053] }}} 

after:

"initialisation": {
    "not_listed": {
        "early": {
            1: {"shape": 0.926963321, "scale": 2127.231053},

@yiwen-h yiwen-h requested a review from morganle-48 as a code owner January 19, 2026 15:44
@yiwen-h yiwen-h self-assigned this Jan 19, 2026
@codecov
Copy link

codecov bot commented Jan 19, 2026

Codecov Report

❌ Patch coverage is 87.09677% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.81%. Comparing base (6f1ac91) to head (201e46b).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
renal_capacity_model/process_outputs.py 0.00% 2 Missing ⚠️
renal_capacity_model/main.py 0.00% 1 Missing ⚠️
renal_capacity_model/model.py 96.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #160      +/-   ##
==========================================
- Coverage   85.89%   85.81%   -0.09%     
==========================================
  Files           9        9              
  Lines         695      691       -4     
  Branches       79       78       -1     
==========================================
- Hits          597      593       -4     
  Misses         89       89              
  Partials        9        9              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@yiwen-h yiwen-h merged commit 25e28ed into main Jan 19, 2026
6 checks passed
@yiwen-h yiwen-h deleted the 151_153_refactor-time-until-death-calculations branch January 19, 2026 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Do not use min() to truncate time_to_death Create reusable function for calculation of time_until_death

2 participants